<script language="javascript" src="__PUBLIC__/Printer/LodopFuncs.js"></script>
<object id="LODOP" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0> 
	<embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0 pluginspage="__PUBLIC__/Printer/install_lodop.exe"></embed>
</object> 

<script language="javascript">
var LODOP; //声明为全局变量
function myPreview() {	
	LODOP=getLodop(document.getElementById('LODOP'),document.getElementById('LODOP_EM'));  
	LODOP.PRINT_INIT("绿风OA办公系统_发货清单");
	LODOP.SET_PRINT_STYLE("FontSize",10);
	createAllPages();
	if (LODOP.PREVIEW())
	{
		$.getJSON(
		"__URL__/doPrint/navTabId/{$Think.const.MODULE_NAME}/id/{$id}",
		function(json)
		{         
			if (json['status'])
			{
				alertMsg.correct(json['msg']);
			}
			else
			{
				alertMsg.error(json['msg']);
			}
			if (json['navTabId'])
			{
				navTab.reload(null, {}, json['navTabId']);
			}
			$.pdialog.closeCurrent();
		}
	); 
	}
	else
	{
		
	}
};

function createAllPages()
{
	index = 0;
	offsetTop = 0;
	<volist name="printList" id="printVo" key="key">
	if ((index % 3) == 0)
	{
		LODOP.NewPage();
		offsetTop = 0;
	}	
	offsetTop =  285 * (index % 3);
	addTable(offsetTop);
	LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
	LODOP.ADD_PRINT_TEXT(offsetTop + 60,90,200,25,"{$printVo.recAddress}");
	LODOP.ADD_PRINT_TEXT(offsetTop + 60,410,120,25,"{$todayDate}");
	LODOP.ADD_PRINT_TEXT(offsetTop + 60,550,150,25,"{$printVo.currentYear}");
	LODOP.ADD_PRINT_TEXT(offsetTop + 100,90,60,25,"{$printVo.provinceID|get_province_name}");
	LODOP.ADD_PRINT_TEXT(offsetTop + 100,230,150,25,"{$printVo.recPeople}");
	LODOP.ADD_PRINT_TEXT(offsetTop + 100,580,150,25,"{$printVo.recTelphone}");
	LODOP.ADD_PRINT_TEXT(offsetTop + 220,590,80,25,"{$printVo.sendGoodsTypeID|get_send_goods_type_name}");
	LODOP.ADD_PRINT_TEXT(offsetTop + 260,590,80,25,"{$printVo.magazineOriginName}");
    <volist name="printVo['magazineList']" id="subVo" key="subKey">
		<if condition="$subKey gt 5">	
			LODOP.ADD_PRINT_TEXT(offsetTop + 180, 80 + ({$subKey} - 6) * 130, 125, 20, "{$subVo['magazineInfo']}");
		<else />
			LODOP.ADD_PRINT_TEXT(offsetTop + 140, 80 + ({$subKey} - 1) * 130, 125, 20, "{$subVo['magazineInfo']}");
		</if>
	</volist>

	index++;

	</volist>
	
};

/* 打印表格 */
function addTable(offsetTop)
{
	LODOP.ADD_PRINT_RECT(offsetTop + 10,25,700,280,0,2);
	LODOP.ADD_PRINT_LINE(offsetTop + 50,25, offsetTop + 51,725,0,1);
	LODOP.ADD_PRINT_LINE(offsetTop + 90,25, offsetTop + 91,725,0,1);
	LODOP.ADD_PRINT_LINE(offsetTop + 130,25, offsetTop + 131,725,0,1);
	LODOP.ADD_PRINT_LINE(offsetTop + 170,25, offsetTop + 171,725,0,1);
	LODOP.ADD_PRINT_LINE(offsetTop + 210,25, offsetTop + 211,725,0,1);
	LODOP.ADD_PRINT_LINE(offsetTop + 250,25, offsetTop + 251,725,0,1);
	LODOP.ADD_PRINT_LINE(offsetTop + 210,80, offsetTop + 50,81,0,1);
	LODOP.ADD_PRINT_LINE(offsetTop + 90,300, offsetTop + 50,301,0,1);
	LODOP.ADD_PRINT_LINE(offsetTop + 90,390, offsetTop + 50,391,0,1);
	LODOP.ADD_PRINT_LINE(offsetTop + 130,530, offsetTop + 50,531,0,1);
	LODOP.ADD_PRINT_LINE(offsetTop + 210,210, offsetTop + 130,211,0,1);
	LODOP.ADD_PRINT_LINE(offsetTop + 210,340, offsetTop + 130,341,0,1);
	LODOP.ADD_PRINT_LINE(offsetTop + 210,470, offsetTop + 130,471,0,1);
	LODOP.ADD_PRINT_LINE(offsetTop + 210,600, offsetTop + 130,601,0,1);
	LODOP.ADD_PRINT_LINE(offsetTop + 290,210, offsetTop + 250,211,0,1);
	LODOP.ADD_PRINT_LINE(offsetTop + 290,490, offsetTop + 210,491,0,1);
	LODOP.ADD_PRINT_TEXT(offsetTop + 15,330,200,25,"发货清单");
	LODOP.SET_PRINT_STYLEA(0,"FontSize",18);
	LODOP.ADD_PRINT_TEXT(offsetTop + 60,35,80,25,"地址");
	LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
	LODOP.ADD_PRINT_TEXT(offsetTop + 60,310,80,25,"制单日期");
	LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
	LODOP.ADD_PRINT_TEXT(offsetTop + 100,180,80,25,"姓名");
	LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
	LODOP.ADD_PRINT_TEXT(offsetTop + 100,540,80,25,"电话");
	LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
	LODOP.ADD_PRINT_TEXT(offsetTop + 220,35,420,25,"发货单位：河南教育读物发行总社有限公司");
	LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
	LODOP.ADD_PRINT_TEXT(offsetTop + 260,35,180,25,"地址：郑州市红旗路99号");
	LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
	LODOP.ADD_PRINT_TEXT(offsetTop + 260,220,270,25,"查询电话：0371-65965766，65994903");
	LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
	LODOP.ADD_PRINT_TEXT(offsetTop + 220,500,90,25,"发货方式：");
	LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
	LODOP.ADD_PRINT_TEXT(offsetTop + 260,500,100,25,"区域负责人：");
}
</script>


<div class="page">

	<div class="pageContent">

		<div class="panelBar">			
			<ul class="toolBar">
				<li><input type="button" value="打印预览" onClick="myPreview()"/></li>
			</ul>
		</div>

		<table class="table" width="100%" layoutH="88" id="PrintList">
			<thead>
			<tr>
				<th width="50">编号</th>
				
				<th width="100">收货人</th>
				<th width="80">省份</th>
				<th width="80">城市</th>				
				<th width="80">单位</th>
				<th width="80">班级</th>
				<th width="80">电话</th>
				<th width="80">地址</th>
				<th width="180">报刊名称</th>
				<th width="80">月份</th>
				<th width="80">期数</th>

				<th width="80">份数</th>
				<th width="60">发行员</th>
				<th width="80">发货方式</th>
				<th width="80">是否打印发货清单</th>
				<th width="80">清单编号</th>
			</tr>
			</thead>
			<tbody>
			<volist id="vo" name="list">
				<tr target="id" rel="{$vo.id}" key="key">
					<td>{$key + 1}</td>

					<td>{$vo.recPeople}</td>
					<td>{$vo.provinceID|get_province_name}</td>
					<td>{$vo.cityName}</td>
					<td>{$vo.schoolID|get_custom_unit_name}</td>
					<td>{$vo.class}</td>
					<td>{$vo.recTelphone}</td>
					<td>{$vo.recAddress|msubstr=0,10}</td>
					<td>{$vo.magazineName}</td>
					<td>{$vo.termMonth}</td>
					<td>{$vo.termName}</td>
					<td>{$vo.sendNum}</td>
					<td>{$vo.postPeople|get_employee_name}</td>
					<td>{$vo.sendGoodsTypeID|get_send_goods_type_name}</td>
					<td><if condition="$vo.isPrintSendGoods eq 1">是<else />否</if></td>
					<td>{$vo.sendGoodsNum}</td>
				</tr>
			</volist>
			</tbody>
		</table>
	</div>
	
</div>

